package com.itheima.homeweek;

import java.math.BigDecimal;
import java.math.MathContext;
import java.math.RoundingMode;

public class HomeWeek01 {//圆的半径为13，求圆的面积

    public static void main(String[] args) {
        BigDecimal bd1 = new BigDecimal(13);
        BigDecimal bd2 = new BigDecimal(Math.PI);
        BigDecimal bd3 = new BigDecimal(1);
        BigDecimal bd4 = new BigDecimal(Math.pow(13, 2));


        System.out.println(bd1.multiply(bd1).multiply(bd2).divide(bd3, 2, BigDecimal.ROUND_HALF_DOWN));

        System.out.println(bd4.multiply(bd2, new MathContext(5, RoundingMode.HALF_UP)));

        double s = Math.PI * Math.pow(13, 2)*100;
        System.out.println(s / 100.0);


    }
}
